<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>


<div class="modal-dialog ms-modal-dialog" style="margin-top:50px;">
	<div class="modal-content">

		<div class="modal-header">
			<button type="button" class="close" data-dismiss="modal">
        <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
      </button>
			<h4 class="modal-title">培训项目查询</h4>
		</div>

		<form class="form-horizontal ms-form modal-search-form" role="form" method="GET" action="${ctx.host}/project-results" data-validate="true">

			<input type="hidden" name="filter" value="true">

			<div class="modal-body">
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">编号：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="code" value="" placeholder="编号" data-validate="required" autocomplete="off" tabindex="0" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3"><span class="text-red">*</span>项目类别：</label>
					<div class="col-xs-8 pull-left">
						<select class="select2 form-control" name="firstCategory" data-validate="required" id="selFirstCat" tabindex="2">
							<option></option>
							<c:forEach items="${persist.trainingCategories}" var="TrainingCategory">
								<option value="${TrainingCategory.id}">${TrainingCategory.name}</option>
							</c:forEach>
						</select>
					</div>
				</div>
				
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">项目名称：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="name" value="" placeholder="项目名称" data-validate="required" autocomplete="off" tabindex="2" />
					</div>
				</div>
				
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">项目负责人：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="projectLead" value="" placeholder="项目负责人" data-validate="required" autocomplete="off" tabindex="3" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3"><span class="text-red">*</span>事业部：</label>
					<div class="col-xs-8 pull-left">
						<select class="select2 form-control" name="department" data-validate="required" id="selDepartment" tabindex="7">
							<c:forEach items="${persist.deparments}" var="department">
								<option></option>
								<option value="${department.id}">${department.name}</option>
							</c:forEach>
						</select>
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">开始时间从：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="beginDateFrom" value="" placeholder="开始时间" data-validate="required" autocomplete="off" tabindex="3" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">至：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="beginDateTo" value="" placeholder="开始时间" data-validate="required" autocomplete="off" tabindex="3" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">结束时间从：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="endDateFrom" value="" placeholder="结束时间" data-validate="required" autocomplete="off" tabindex="3" />
					</div>
				</div>
				<div class="form-group  ms-form-group">
					<label class="control-label col-xs-3">至：</label>
					<div class="col-xs-8">
						<input type="text" class="form-control" name="endDateTo" value="" placeholder="结束时间" data-validate="required" autocomplete="off" tabindex="3" />
					</div>
				</div>

			</div>

			<div class="modal-footer ms-modal-footer">
				<button type="submit" class="btn btn-shadow-success btn-shadow umu-btn">查询</button>
				<button type="button" class="btn btn-shadow-default btn-shadow umu-btn" data-dismiss="modal">取消</button>
			</div>

		</form>

	</div>
</div>
<script>
	$("#selFirstCat").trigger('change');
	$(document).ready(function() {
		$('select[name="department"]').select2({
			theme: "classic",
			placeholder: '请选择事业部',
			minimumResultsForSearch: 1,
			allowClear: true
		});
	})
</script>